Upload to Github Container Registry#479
Conversation
WalkthroughThe pull request extends CI/CD workflows and Docker image configurations to support the GitHub Container Registry (ghcr.io). New steps have been added in GitHub Actions workflows to log in to ghcr.io alongside DockerHub. Additionally, GoReleaser configuration files have been updated with extra image templates and manifest entries for publishing images to ghcr.io for multiple architectures and tagging schemes. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant GA as GitHub Actions
participant DH as DockerHub
participant GHCR as GitHub Container Registry
Dev->>GA: Push code changes
GA->>DH: Login to DockerHub
GA->>GHCR: Login to GH Container Registry (docker/login-action@v3)
GA->>GHCR: Publish Docker images (snapshot workflow)
Assessment against linked issues
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (4)
.github/workflows/docker.yml (1)
39-45: Addition of GitHub Container Registry Login Step with a Minor Formatting FixThe new step to log in to
ghcr.iois implemented correctly and nicely complements the existing DockerHub login. However, please remove any trailing whitespace on line 45 to meet YAML linting standards.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 45-45: trailing spaces
(trailing-spaces)
.github/workflows/release.yml (1)
34-40: GitHub Container Registry Login IntegrationThe new login step for
ghcr.iois consistent with similar changes in other workflows, ensuring reliable multi-registry authentication. Please address the trailing spaces on line 40.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 40-40: trailing spaces
(trailing-spaces)
.github/workflows/snapshot.yml (2)
33-39: Implementation of GitHub Container Registry Login StepThe added login step for
ghcr.iois consistent with the updates made in other workflows. Please verify that no extraneous trailing whitespace is present in this segment.
64-75: GitHub Container Registry Publishing Step with Minor Formatting IssuesThe new step for publishing images to
ghcr.iois well-implemented, correctly handling Docker manifest creation and push. Please remove trailing spaces on line 74 and ensure the file ends with a newline to satisfy YAML linting requirements.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 74-74: trailing spaces
(trailing-spaces)
[error] 75-75: no new line character at the end of file
(new-line-at-end-of-file)
[error] 75-75: trailing spaces
(trailing-spaces)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.github/workflows/docker.yml(1 hunks).github/workflows/release.yml(1 hunks).github/workflows/snapshot.yml(3 hunks).goreleaser-docker-only.yml(3 hunks).goreleaser-snapshot.yml(2 hunks).goreleaser.yml(3 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/docker.yml
[error] 45-45: trailing spaces
(trailing-spaces)
.github/workflows/release.yml
[error] 40-40: trailing spaces
(trailing-spaces)
.github/workflows/snapshot.yml
[error] 74-74: trailing spaces
(trailing-spaces)
[error] 75-75: no new line character at the end of file
(new-line-at-end-of-file)
[error] 75-75: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Build and test (1.24, windows-latest)
🔇 Additional comments (10)
.goreleaser-snapshot.yml (2)
32-33: Addition of Image Template for GitHub Container Registry (amd64)The new image template
"ghcr.io/creativeprojects/resticprofile:nightly-amd64"has been added correctly and aligns well with the strategy of supporting multiple registries.
53-54: Addition of Image Template for GitHub Container Registry (arm64v8)The inclusion of
"ghcr.io/creativeprojects/resticprofile:nightly-arm64v8"is coherent with the other image templates and properly extends support for GitHub Container Registry..github/workflows/snapshot.yml (1)
53-63: DockerHub Publishing Step UpdateThe addition of
shell: bashin the "Publish to DockerHub" step ensures commands are executed uniformly, which enhances the reliability of the workflow..goreleaser-docker-only.yml (3)
34-35: Addition of GitHub Container Registry Image Templates for amd64The new templates
"ghcr.io/creativeprojects/resticprofile:latest-amd64"and"ghcr.io/creativeprojects/resticprofile:{{ .RawVersion }}-amd64"have been correctly added. They effectively broaden the image publishing scope across both DockerHub and GitHub Container Registry.
57-58: Addition of GitHub Container Registry Image Templates for arm64v8The newly introduced templates
"ghcr.io/creativeprojects/resticprofile:latest-arm64v8"and"ghcr.io/creativeprojects/resticprofile:{{ .RawVersion }}-arm64v8"maintain consistency with the overall Docker configuration, which is a positive enhancement.
88-97: Expanded Docker Manifest Definitions for GitHub Container RegistryThe extended manifest definitions for
ghcr.ioentries (both for the versioned and latest tags) have been integrated effectively. This change ensures a unified approach to image publishing across registries..goreleaser.yml (4)
137-138: Approved: New Docker Image Templates for ghcr.io on amd64.The new entries
"ghcr.io/creativeprojects/resticprofile:latest-amd64"and"ghcr.io/creativeprojects/resticprofile:{{ .RawVersion }}-amd64"have been added correctly. They follow the established naming conventions and align with the intention to support the GitHub Container Registry.
159-160: Approved: New Docker Image Templates for ghcr.io on arm64.The added image templates
"ghcr.io/creativeprojects/resticprofile:latest-arm64v8"and"ghcr.io/creativeprojects/resticprofile:{{ .RawVersion }}-arm64v8"correctly extend support for the arm64 architecture through the GitHub Container Registry.
188-192: Approved: Docker Manifest Entry for Versioned ghcr.io Images.This new manifest entry groups architecture-specific images for the versioned ghcr.io image:
- It consolidates the
{{ .RawVersion }}tag with both amd64 and arm64 variants.- The templating is consistent with the rest of the file.
Everything is in order.
193-195: Approved: Docker Manifest Entry for Latest ghcr.io Images.The manifest entry correctly maps the latest tag to the appropriate architecture-specific images for ghcr.io. It ensures that both amd64 and arm64 variants are included under the
latesttag.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #479 +/- ##
=======================================
Coverage 79.22% 79.22%
=======================================
Files 133 133
Lines 13204 13204
=======================================
Hits 10460 10460
Misses 2326 2326
Partials 418 418
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/snapshot.yml (1)
65-74: New Publishing Step for GitHub Container Registry.
The new step for publishing images to the GitHub Container Registry mirrors the DockerHub process, handling both pushing and manifest operations for multiple image tags. While the implementation is clear and functional, you might consider refactoring the manifest creation steps in the future to reduce duplication and improve maintainability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/docker.yml(1 hunks).github/workflows/release.yml(2 hunks).github/workflows/snapshot.yml(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- .github/workflows/docker.yml
- .github/workflows/release.yml
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Build and test (1.24, windows-latest)
🔇 Additional comments (3)
.github/workflows/snapshot.yml (3)
4-4: Manual Trigger Added for Workflow Dispatch.
The addition ofworkflow_dispatchto the workflow triggers greatly improves flexibility by allowing manual execution. This is particularly useful for on-demand testing and deployments.
34-40: New Login Step for GitHub Container Registry.
The new login step usingdocker/login-action@v3is well-configured to authenticate with ghcr.io using the GitHub actor’s username and token from secrets. Please ensure that theGITHUB_TOKENprovided has the necessary permissions to push images to the GitHub Container Registry.
55-63: Explicit Shell Specification for DockerHub Publishing.
Specifyingshell: bashin the "Publish to DockerHub" step is a good enhancement for ensuring that multi-line shell commands execute as intended across different environments.
Fixes #477